﻿using log4net;
using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using WLYT.Application.Interfaces;
using WLYT.Domain.Enum;

namespace WLYT.Admin.WebApi.Component.Quartz
{
    [DisallowConcurrentExecution]
    public class CronTask : IJob
    {
        private readonly IAgvService AgvService;
        public CronTask(IAgvService agvService)
        {
            AgvService = agvService;
        }
        //private static readonly ILog loginfo = LogManager.GetLogger("loginfo");
        public string TaskName { get; set; }
        public async Task Execute(IJobExecutionContext context)
        {
            try
            {
                //if(TaskName == "AgvToSMC")
                //{
                //    await AgvService.ToUse(AgvPointMapType.湿敏仓_出库, AgvPodType.料箱);
                //}
                //else
                //{
                //    await AgvService.ToUse(AgvPointMapType.智能货柜, AgvPodType.料箱);
                //}
            }
            catch (Exception ex)
            {
                // do you want the job to refire?
                throw new JobExecutionException(msg: "", refireImmediately: true, cause: ex);
            }
        }
    }
}